/**
 * 
 */
package wpmp.security.mgr.utils;

import org.apache.commons.lang3.ArrayUtils;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;

/**
 * @author Wayne.Wang<5waynewang@gmail.com>
 * @since 11:42:13 AM Dec 5, 2013
 */
public class HibernateUtils {

	public static final Criteria addOrders(Criteria criteria, Order... orders) {
		if (ArrayUtils.isEmpty(orders)) {
			return criteria;
		}
		for (Order order : orders) {
			criteria.addOrder(order);
		}
		return criteria;
	}
}
